package com.bwie.mq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lenovo
 */
@Configuration
public class RabbitMq {

    @Bean
    public Queue queue(){
        return new Queue("dishesQueue");
    }

    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("dishesExchange");
    }

    @Bean
    public Binding binding(){
        return BindingBuilder.bind(queue()).to(directExchange()).with("dishesBinding");
    }
}
